import service from '@/utils/request'
import {ApiResponse,ListApiResponse} from '@/store/dataType.ts'

export interface BpmnCategory {
  id: number // 分类编号
  name: string // 分类名
  modelCategory: string // 模型分类
  status: number // 分类状态
  sort: number // 分类排序
}

export const API_BPMN_CATEGORY = {
  getBpmnCategoryList:(query:any):Promise<ListApiResponse>=> {return service.get('/workflow/category/list',{params:query})},
  createBpmnCategory:(data:any):Promise<ApiResponse> =>  {return service.post('/workflow/category/create',data)},
  updateBpmnCategory:(data:any):Promise<ApiResponse>=>  {return service.put('/workflow/category/update',data)},
  getBpmnCategory:(id:string|number):Promise<ApiResponse>=>  {return service.get('/workflow/category/'+id)},
  deleteBpmnCategory:(id:string|number):Promise<ApiResponse> =>  {return service.delete('/workflow/category/delete/'+id)},
  // 批量修改流程分类的排序
  updateCategorySortBatch:  (ids: number[]) => {return  service.put(`/workflow/category/update-sort-batch`,{params: {ids: ids.join(',')}})},
  getCategoryAllList:  () => {return  service.get(`/workflow/category/all`)},
}



